#!/bin/bash
pkgname=VNPOSTMAX-news
path=/www/wwwroot/www.st5pro.cm
tarname=$pkgname.tar.gz
ip=52.66.245.221
user=ubuntu

# 压缩
projectPath=`pwd`

tar zvcf $pkgname.tar.gz * --exclude= $projectPath/ST5DEMO.pem --exclude= $projectPath/zsf.sh
echo "scp to remote..."
scp   -P 22 -i  $projectPath/ST5DEMO.pem    $tarname $user@$ip:~
echo "remove local tar"
rm -f $tarname
ssh  -p 22 -i $projectPath/ST5DEMO.pem  $user@$ip "sudo cp ~/$tarname $path;  cd $path;sudo tar zxf $tarname ; sudo rm -f $tarname"





